<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="../css/common.css">
    <style>
        .login_container {
            display: flex;
            justify-content: flex-start;
            align-items: flex-start;
            padding: 15%;
            height: 100vh;
        }
        .login_card {
            width: 400px;
            height: 300px;
            background-color: #ffffffad;
            border-radius: 10px;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            padding: 20px;
            box-sizing: border-box;
        }
        .login_card h2 {
            margin-bottom: 20px;
        }
        .login_card input {
            width: 80%;
            padding: 10px;
            margin: 10px 0;
            border: 1px solid #ccc;
            border-radius: 5px;
            color: #fb78b9;
        }
        
        .login_card button {
            width: 80%;
            padding: 10px;
            background-color: rgb(255, 145, 164);
            color: white;
            border: none;
            border-radius: 5px;
            cursor: pointer;
        }
        .login_card button:hover {
            background-color: #ff69b4;
        }
    </style>
</head>
<body>
    <div class="nav">
        <img src="../img/logo.png" alt="">
        <span>我的博客系统</span>
    </div>
    <div class="login_container">
        <div class="login_card">
            <h2>登录</h2>
            <input type="text" name="username" placeholder="用户名" required>
            <input type="password" name="password" placeholder="密码" required>
            <button type="submit">登录</button>
        </div>
    </div>
</body>
<script>
    document.querySelector('.login_card button').addEventListener('click', function() {
        const username = document.querySelector('input[name="username"]').value;
        const password = document.querySelector('input[name="password"]').value;
        
        if (username && password) {
            // 这里可以添加登录逻辑，比如发送请求到服务器验证用户名和密码
            // 登录成功后可以跳转到主页或其他页面
            window.location.href = 'blog_list.html'; // 假设登录成功后跳转到主页
        } else {
            alert('请输入用户名和密码！');
        }
    });

</script>
</html>